Update USM commands to remove on-prem to cloud Kafka ID mapping and simplify connect operations - #3416
Update USM commands to remove on-prem to cloud Kafka ID mapping and simplify connect operations#3416Karan Singh Khati (karanskhati) wants to merge 2 commits into
Conversation
…implify connect operations
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
This PR updates Unified Stream Manager (USM) Connect commands to stop deriving the USM Kafka cluster ID via an on-prem (Confluent Platform) Kafka cluster ID mapping, instead attempting to read the USM Kafka cluster ID directly from the Connect cluster API response. It also bumps the USM SDK dependency version to align with the updated API surface.
Changes:
- Remove the helper that built a Confluent Platform Kafka ID → USM Kafka ID map and stop logging “cluster not found” errors during Connect operations.
- Update
connect register,connect describe, andconnect listoutput to useGetUsmKafkaClusterId()from the Connect cluster object. - Upgrade
github.com/confluentinc/ccloud-sdk-go-v2/usmfromv0.1.0tov0.2.0(with correspondinggo.sumchanges).
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/unified-stream-manager/command_connect.go | Simplifies Connect table printing and removes the on-prem→USM Kafka ID mapping helper. |
| internal/unified-stream-manager/command_connect_register.go | Removes mapping lookup/logging and prints Connect output using the returned cluster object only. |
| internal/unified-stream-manager/command_connect_list.go | Stops mapping lookup/logging and uses GetUsmKafkaClusterId() for list output. |
| internal/unified-stream-manager/command_connect_describe.go | Removes mapping lookup/logging and prints describe output via printConnectTable. |
| go.mod | Bumps USM SDK dependency to v0.2.0. |
| go.sum | Updates module sums due to the dependency bump. |
Comments suppressed due to low confidence (2)
internal/unified-stream-manager/command_connect.go:80
USMKafkaClusterIdis now sourced fromconnect.GetUsmKafkaClusterId(), but the USM Connect cluster API responses (and the integration test server) do not populate that field today (seetest/test-server/usm_handlers.go:160-177and:204-211, which only setKafkaClusterId). This will result in an empty "USM Kafka Cluster ID" column/JSON field forconnect register,connect list, andconnect describe, and breaks the existing golden fixtures that expectusmkc-...values.
To avoid this regression, either (a) keep a fallback lookup from Confluent Platform Kafka cluster ID -> USM Kafka cluster ID when GetUsmKafkaClusterId() is empty, or (b) ensure the backend/test server responses include usm_kafka_cluster_id and update fixtures accordingly.
out := &connectOut{
Id: connect.GetId(),
ConfluentPlatformConnectCluster: connect.GetConfluentPlatformConnectClusterId(),
USMKafkaClusterId: connect.GetUsmKafkaClusterId(),
ConfluentPlatformKafkaClusterId: connect.GetKafkaClusterId(),
Cloud: connect.GetCloud(),
Region: connect.GetRegion(),
Environment: connect.Environment.GetId(),
}
internal/unified-stream-manager/command_connect_list.go:53
listConnectnow printsUSMKafkaClusterIdfromcluster.GetUsmKafkaClusterId(), but the USM Connect cluster list response in the integration test server does not set this field (it only setsKafkaClusterId; seetest/test-server/usm_handlers.go:160-178). As a result, the "USM Kafka Cluster ID" column/JSON field will be empty and the existingtest/fixtures/output/unified-stream-manager/connect/list*.goldenexpectations will no longer match.
Consider restoring the previous ID-derivation (or a fallback when GetUsmKafkaClusterId() is empty), or update the backend/test server contract and goldens to include the USM Kafka cluster ID in connect-cluster responses.
out := &connectOut{
Id: cluster.GetId(),
ConfluentPlatformConnectCluster: cluster.GetConfluentPlatformConnectClusterId(),
USMKafkaClusterId: cluster.GetUsmKafkaClusterId(),
ConfluentPlatformKafkaClusterId: cluster.GetKafkaClusterId(),
Cloud: cluster.GetCloud(),
Region: cluster.GetRegion(),
Environment: cluster.Environment.GetId(),
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|




Release Notes
New Features
confluent usm connect register,describe, andlistnow display the USM Kafka Cluster ID for every Connect cluster; including those backed by native Confluent Cloud (lkc-) Kafka clusters sourced directly from the API response.Checklist
Whatsection below whether this PR applies to Confluent Cloud, Confluent Platform, or both.Test & Reviewsection below.Blast Radiussection below.What
Applies to: Confluent Cloud (USM).
This updates the
usm connectcommands to consume the new read-onlyusm_kafka_cluster_idfield added to the public USM SDK in ccloud-sdk-go-v2/usm v0.2.0 (confluentinc/ccloud-sdk-go-v2#367).Previously the CLI derived the USM Kafka Cluster ID client-side: it listed all USM Kafka clusters (
ListUsmKafkaClusters) and mapped the Confluent Platform Kafka cluster ID → USM Kafka cluster ID. That extra call could not resolve Connect clusters backed by native Confluent Cloud (lkc-) Kafka clusters (which are not USM Kafka clusters), so the field rendered empty and logged a spurious error.Now
register,describe, andlistreadusm_kafka_cluster_idstraight from the API response (the USM control plane already returns it on all three paths), and the client-side mapping (getOnPremToCloudKafkaIdMap) is removed. This also drops one redundant API round-trip per command.ccloud-sdk-go-v2/usmv0.1.0 → v0.2.0.usm_kafka_cluster_id(golden fixtures unchanged).Blast Radius
Confluent Cloud customers using
confluent usm connect register,describe, orlist. Worst case, if the API response omitsusm_kafka_cluster_id, the column renders empty — no error, no crash.deregisterand allusm kafkacommands are unaffected.References
ccloud-sdk-go-v2/usmv0.2.0Test & Review
make test(unit + integration): updated theusm connecttest-server mock to populateusm_kafka_cluster_id; allTestUsmConnect/TestUsmKafkacases pass with the golden fixtures unchanged.